ip="192.168.0.14"
specialPort="3333"
ICMPnum="8"

#### Functions for individual tests #####
test1()
{
	hping3 ${ip} -S -p 23 -c 3 # send 3 SYNs to port 23 (telnet)
}

test2()
{
	hping3 ${ip} -S -p ${specialPort} -c 3 # send 3 SYNs to user-defined port
}

test3()
{
	hping3 -C --icmptype ${ICMPnum} ${ip} # send to user-defined icmp type
}

test4()
{
	hping3 ${ip} -S -p 22 -c 3 # send 3 SYNs to port 22 (ssh)
}

test5()
{
	hping3 ${ip} -S -a ${ip} -p 80 -c 3 # send 3 SYNs from firewall ip to firewall ip, port 80
}

test6()
{
	hping3 ${ip} -S -p 1033 -c 3
}

test7()
{
	test2 # ensure there is established traffic to an accepted port
	hping3 ${ip} -S -p ${specialPort} -c 3
}

test8()
{
	hping3 ${ip} -S -F -p 80 -c 3
}

test9()
{
	hping3 ${ip} -S -p 23 -c 3
}

test10()
{
	hping3 ${ip} -S -p 32773 -c 3
}

test11()
{
	hping3 ${ip} -S -p 138 -c 3
}

test12()
{
	hping3 ${ip} -S -p 111 -c 3
}

test13()
{
	hping3 ${ip} -S -p 515 -c 3
}

test14()
{
	hping3 ${ip} -S -p 21 -c 3 # ftp control
}

test15()
{
	hping3 ${ip} -S -p 22 -c 3 # ssh
}

test16()
{
	hping3 ${ip} -S -p 20 -c 3 # ftp data
}

#### User input / program driver ####
clear
echo "TEST SUITE"
echo "----------"
echo "1) Default policy is DROP"
echo "2) ALLOW packets to user-defined port"
echo "3) ALLOW packets of user-defined ICMP type"
echo "4) DROP packets addressed to firewall machine"
echo "5) DROP packets spoofed to address within internal subnet"
echo "6) DROP SYN packets to high ports"
echo "7) ALLOW established TCP traffic"
echo "8) DROP packets with SYN & FIN bits set"
echo "9) DROP telnet traffic"
echo "10) DROP incoming packets to ports 32768:32775"
echo "11) DROP incoming packets to ports 137:139"
echo "12) DROP incoming packets to port 111"
echo "13) DROP incoming packets to port 515"
echo "14) Mangle FTP control packets for minimum delay"
echo "15) Mangle SSH packets for minimum delay"
echo "16) Mangle FTP data packets for maximum throughput"
echo "Enter test number to run (0 for all): "
read tnum

case "$tnum" in
0)
	test1
	test2
	test3
	test4
	test5
	test6
	test7
	test8
	test9
	test10
	test11
	test12
	test13
	test14
	test15
	test16
;;
1)
	test1
;;
2)
	test2
;;
3)
	test3
;;
4)
	test4
;;
5)
	test5
;;
6)
	test6
;;
7)
	test7
;;
8)
	test8
;;
9)
	test9
;;
10)
	test10
;;
11)
	test11
;;
12)
	test12
;;
13)
	test13
;;
14)
	test14
;;
15)
	test15
;;
16)
	test16
;;
esac

